read_csv("data_gdp.csv", show_col_types = FALSE) |>
mutate(date = yearquarter(date)) |>
as_tsibble(index = date)Forecasting Mexico’s Economic Growth
Time Series final project Spring 2023
1 Introduction
The main goal of the project is to produce forecasts of Mexico’s Gross Domestic Product.
2 The data
The file provided named data_gdp.csv contains the following variables:
-
date- date variable in quarters, from 1993 Q1 to 2021 Q2.
-
gdp- Real Gross Domestic Product for Mexico
- Units: Mexican Pesos (MXN)
-
consumption- Real Private Sector Final Consumption Expenditure for Mexico
- Units: MXN
-
gov_exp
- Real General Government Final Consumption Expenditure for Mexico
- Units: MXN
-
imports- Real Imports of Goods and Services for Mexico
- Units: MXN
-
exports- Real Exports of Goods and Services for Mexico
- Units: MXN
-
unemployment- Unemployment Rate: Aged 15 and Over: All Persons for Mexico
- Units: %
-
usd- National Currency to US Dollar Exchange Rate: Average of Daily Rates for Mexico
- Units: MXN
-
uncertainty- World Uncertainty Index for Mexico
- Units: Index
You can import the data into R as follows:
The tsibble should look something like this:
3 Objectives
3.1 Research
- Research about economic growth in general, and regarding the Gross Domestic Product (GDP).
- Research anything specific to Mexico concerning GDP or economic growth.
3.2 Exploratory Data Analysis (EDA)
- Perform the EDA as we’ve seen throughout the semester.
The EDA can include any of the following:
-
Visualization
- Scatter plots
- Time plots
- Seasonal plots
- TS decomposition
- Boxplots
- Histograms, density plots, violin plots, raincloud plots, etc.
Correlation/Autocorrelation analysis
Checking whether the variables need any transformations/adjustments.
Checking for outliers.
Functions like gg_tsdisplay(), gg_season(), gg_subseries(), GGally::ggpairs(), autoplot(), and naturally ggplot() can help you get many plots in a nice, easy and convenient way.
3.3 Model specification
The results derived from the EDA should point you towards which models to fit.
There are many things you can try out, besides just the differe nt models, such as:
- Transformations/adjustments
- Forecasting using decomposition
- Model combinations
- Handling outliers
- For multivariate models, using dummy variables
- Fourier transformations to account for seasonality
3.4 Forecasting
You should produce forecasts with a 6 quarter time horizon (i.e., forecast until 2022 Q4).
4 Grading
Each group will be graded according to their MAPE error forecast. The group that manages to get the lowest MAPE possible will get the best score. However, all the project will be taken into account for the final grade.
You must submit:
- The quarto document (
.qmd). - The HTML/pptx file of the render.
- An
.RDatafile containing only yourfable(forecasts table), with your final model (one model, one forecast).
.RData file
- Both your
fable, and your model must be renamed with “equipo_” and the group number that you are placed in. i.e., “equipo_4” if you’re in group number 4, such as:
equipo_4 <- tsbl |>
model(
equipo_4 = TSLM(y ~ x)
)- You can download the .RData file using the
save()function, defining the objeect’s name, and the file extension. An example would besave(equipo_4, file = "equipo_4.RData").